package org.example;

import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.model.openai.OpenAiChatModel;

import java.time.Duration;

/**
 * Hello world!
 */
public class App {
    public static void main(String[] args) {
        ChatLanguageModel openAiLanguageModel = OpenAiChatModel.builder()
                .apiKey("sk-237b9b8d6542400385f3f0e274a047f4")
                .modelName("deepseek-chat")
                .baseUrl("https://api.deepseek.com")
                .logRequests(true)
                .logResponses(true)
                .timeout(Duration.ofSeconds(10))
                .maxRetries(3)
                .build();

        System.out.println(openAiLanguageModel.chat("介绍一下你自己"));

    }
}
